/**
 * 2013，thor.com，all rights reserved。
 * 
 * Project：		http-client
 * Filename：	QueryResult.java
 * Created：		2013-6-30
 * Creator：		thor
 */
package com.jeecg.query;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import org.codehaus.jackson.annotate.JsonIgnore;



/**
 * @author thor
 * 
 */
public class QueryResult<E> implements Serializable {
  private static final long serialVersionUID = 6061257878415044496L;

  public boolean hasMore() {
    return paging.getPage() < paging.getPageCount() - 1;
  }

  private QueryResultPaging paging = new QueryResultPaging();
  private List<E> records = new ArrayList<E>();

  /** 分页信息 */
  public QueryResultPaging getPaging() {
    return paging;
  }

  public void setPaging(QueryResultPaging paging) {
    this.paging = paging;
  }

  /** 记录 */
  public List<E> getRecords() {
    return records;
  }

  public void setRecords(List<E> records) {
    this.records = records;
  }

  @JsonIgnore
  // @com.fasterxml.jackson.annotation.JsonIgnore
  public int getPage() {
    return paging.getPage();
  }

  public void setPage(int page) {
    paging.setPage(page);
  }

  @JsonIgnore
  // @com.fasterxml.jackson.annotation.JsonIgnore
  public int getPageSize() {
    return paging.getPageSize();
  }

  public void setPageSize(int pageSize) {
    paging.setPageSize(pageSize);
  }

  @JsonIgnore
  // @com.fasterxml.jackson.annotation.JsonIgnore
  public int getPageCount() {
    return paging.getPageCount();
  }

  public void setPageCount(int pageCount) {
    paging.setPageCount(pageCount);
  }

  @JsonIgnore
  // @com.fasterxml.jackson.annotation.JsonIgnore
  public long getRecordCount() {
    return paging.getRecordCount();
  }

  public void setRecordCount(long recordCount) {
    paging.setRecordCount(recordCount);
  }

}
